package com.example.administrator.mywebviewdemo;

/**
 * Created by Administrator on 2017/9/7 0007.
 */

import android.content.Context;
import android.os.Environment;

import com.tencent.sonic.sdk.SonicRuntime;

import java.io.File;

/**
 * Here is a sample subclass of SonicRuntime
 */
public abstract class HostSonicRuntime extends SonicRuntime {
    public HostSonicRuntime(Context context) {
        super(context);
    }
    /**
     * @return User's UA
     */
    @Override
    public String getUserAgent() {
        return "";
    }
    /**
     * @return the ID of user.
     */
    @Override
    public String getCurrentUserAccount() {
        return "";
    }
    /**
     * @return the file path which is used to save Sonic caches.
     */
    @Override
    public File getSonicCacheDir() {
        String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator         + "sonic/";
        File file = new File(path.trim());
        if(!file.exists()){
            file.mkdir();
        }
        return file;
    }
}